import request from "@/utils/request";

/**
 * 获取数据源列表
 * @param param
 * @returns {*}
 */
export function getDatabaseListPage(param){
    return request({
        url: '/kettle/database/list',
        method: 'get',
        params: param
    })
}

/**
 * 添加或更新数据源
 * @param data
 * @returns {*}
 */
export function postDatabase(data){
    return request({
        url: '/kettle/database',
        method: 'POST',
        data
    })
}

/**
 * 删除数据源
 * @param id
 * @param data
 * @returns {*}
 */
export function deleteDatabase(id, data){
    return request({
        url: `/kettle/database/${id}`,
        method: 'DELETE',
        data: data
    })
}

/**
 * 数据源连接测试
 * @param data
 * @returns {*}
 */
export function databaseTest(data){
    return request({
        url: '/kettle/database/line/test',
        method: 'POST',
        data: data
    })
}
